package com.hd.sup.modules.file.enums;

/**
 * @version V1.0
 * @Project 交通运输第三方监测平台
 * @Title UploadPathEnum.java
 * @Description 上传路径枚举
 * @Package com.hd.sup.modules.common.enums
 * @date 2021/1/14 5:15 下午
 * @Copyright: 深圳市宏电技术股份有限公司 All rights reserved.
 */
public enum UploadPathEnum {
    //小程序使用
    BASE64("base64", "base64"),
    // 默认其它文件路径
    FILE_PATH("file", "file"),
    // 默认图片路径
    IMAGE_PATH("image", "image"),
    // 默认文档路径
    DOC_PATH("doc", "doc");

    private String type;
    private String path;

    UploadPathEnum(String type, String path) {
        this.type = type;
        this.path = path;
    }

    public static UploadPathEnum get(String type) {
        for (UploadPathEnum pathEnum : values()) {
            if (pathEnum.getType().equals(type)) {
                return pathEnum;
            }
        }
        return null;
    }

    public String getType() {
        return type;
    }

    public String getPath() {
        return path;
    }
}
